package com.d3works.apps.crm.module;

import com.d3works.app.D3worksModule;
import com.d3works.apps.base.db.repo.ICalendarRepository;
import com.d3works.apps.base.ical.ICalendarEventFactory;
import com.d3works.apps.base.ical.ICalendarService;
import com.d3works.apps.crm.db.Event;
import com.d3works.apps.crm.db.repo.CrmBatchCrmRepository;
import com.d3works.apps.crm.db.repo.CrmBatchRepository;
import com.d3works.apps.crm.db.repo.EventManagementRepository;
import com.d3works.apps.crm.db.repo.EventRepository;
import com.d3works.apps.crm.db.repo.LeadManagementRepository;
import com.d3works.apps.crm.db.repo.LeadRepository;
import com.d3works.apps.crm.db.repo.OpportunityManagementRepository;
import com.d3works.apps.crm.db.repo.OpportunityRepository;
import com.d3works.apps.crm.service.CalendarService;
import com.d3works.apps.crm.service.EventService;
import com.d3works.apps.crm.service.EventServiceImpl;
import com.d3works.apps.crm.service.LeadService;
import com.d3works.apps.crm.service.LeadServiceImpl;
import com.d3works.apps.crm.service.OpportunityService;
import com.d3works.apps.crm.service.OpportunityServiceImpl;
import com.d3works.apps.crm.service.app.AppCrmService;
import com.d3works.apps.crm.service.app.AppCrmServiceImpl;

public class CrmModule extends D3worksModule {

  @Override
  protected void configure() {
    bind(EventRepository.class).to(EventManagementRepository.class);
    bind(LeadRepository.class).to(LeadManagementRepository.class);
    bind(OpportunityRepository.class).to(OpportunityManagementRepository.class);
    bind(OpportunityService.class).to(OpportunityServiceImpl.class);
    bind(ICalendarService.class).to(CalendarService.class);
    bind(AppCrmService.class).to(AppCrmServiceImpl.class);
    bind(EventService.class).to(EventServiceImpl.class);
    bind(CrmBatchRepository.class).to(CrmBatchCrmRepository.class);
    bind(LeadService.class).to(LeadServiceImpl.class);
    ICalendarEventFactory.register(ICalendarRepository.CRM_SYNCHRO, Event::new);
  }
}
